//
//  RMMOrdHeadView.m
//  Romomo
//
//  Created by puman on 2016/10/21.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMOrdHeadView.h"

@implementation RMMOrdHeadView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(15, 5, self.width - 30, 30)];
        view.layer.masksToBounds = YES;
        view.layer.cornerRadius = view.height / 2;
        view.layer.borderWidth = 1;
        view.layer.borderColor = COLORFROMCODE(0xEEEEEE, 1).CGColor;
        [self addSubview:view];
        CGFloat width = (view.width - 6)/ 4;
        CGFloat height= view.height - 6;
        NSArray *titleArray = @[@"进行中",@"待评价",@"已完成",@"已取消"];
        for (int i = 0; i < 4; i++) {
            UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
            button.frame = CGRectMake(3 + width * i, 3, width, height);
            button.layer.cornerRadius = height/ 2;
            button.backgroundColor = kWhiteColor;
            [button setTitle:titleArray[i] forState:(UIControlStateNormal)];
            [button setTitleColor:COLORFROMCODE(0xBFBFBF, 1) forState:(UIControlStateNormal)];
            button.titleLabel.font = kFont(13);
            if (i == 0) {
                button.userInteractionEnabled = NO;
                [button setTitleColor:COLORFROMCODE(0x2C2C2C, 1) forState:(UIControlStateNormal)];
                button.backgroundColor = COLORFROMCODE(0xEEEEEE, 1);
            }
            button.tag = 10 + i;
            [view addSubview:button];
        }

        
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
